#include "stdafx.h"
#include <windows.h>
#include <iostream>
using namespace std;
using std::cout;
using std::cin;


class Singleton
{
private:
    static int count;
    Singleton()
    {
        //private constructor
    }
public:
    static Singleton* getInstance();
};

int Singleton::count=0;
Singleton* Singleton::getInstance()
{
    if(count==0)
    {
        Singleton* single = new Singleton();
		cout<<"one object created"<<endl;
        count++;
        return single;
    }
    else
    {
        cout<<"Warning!!!  Only one object can be created";
    }
}

int main()
{
    Singleton *sc1,*sc2;
    sc1 = Singleton::getInstance();
    sc2 = Singleton::getInstance();
    return 0;
}